package ldh.im.web.controller;

import ldh.im.business.constant.CategoryStatus;
import ldh.im.business.pojo.CmsCategory;
import ldh.im.business.pojo.Tenant;
import ldh.im.business.pojo.where.CmsCategoryWhere;
import ldh.im.business.pojo.where.TenantWhere;
import ldh.im.business.service.CmsCategoryService;
import ldh.im.web.service.TenantService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class BaseController {

    @Resource(name = "tenantService")
    protected TenantService tenantService;
    @Resource(name = "cmsCategoryService")
    protected CmsCategoryService categoryService;

    public List<Tenant> getAllTenants(){
        return tenantService.getAll(new TenantWhere());
    }

    public List<CmsCategory> getAllCategories(){
        return categoryService.getAll(new CmsCategoryWhere());
    }
}
